package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
@Api(tags = "护理项目信息相关接口")
public class MemberNursingProject extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 分页查询护理项目列表
     *
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("分页查询护理项目")
    public TableDataInfo list(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
        TableDataInfo tableDataInfo = nursingProjectService.selectPage(pageNum, pageSize);
        return tableDataInfo;
    }

    /**
     * 获取护理项目详细信息
     */
    @ApiOperation("获取护理项目详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@ApiParam(value = "护理项目ID", required = true)
                              @PathVariable("id") Long id) {
        return success(nursingProjectService.selectNursingProjectById(id));
    }
}
